<!DOCTYPE html>
<html>
<head>

    <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="__CSS__/animate.min.css" rel="stylesheet">
    <link href="__CSS__/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="__CSS__/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <style>

        .tr:nth-child(even){
            background-color:white ;
        }

    </style>

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRightBig">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>常用人员列表</h5>
                </div>
                <div class="ibox-content col-sm-12" style="display:inline-block;margin:10px 0">
                    <form action="{:url('memberlist')}" type="get">
                        <div class="input-group" style="width:200px;float:left;margin-right:9px;">
                            <span class="input-group-addon">姓名:</span>
                            <input type="text" name="real_name" value="{:input('real_name')}" class="form-control"  placeholder="姓名">
                        </div>
                        <div class="input-group" style="width:200px;float:left;margin-right:9px;">
                            <span class="input-group-addon">电话:</span>
                            <input type="text" name="phone" value="{:input('phone')}" class="form-control"  placeholder="电话">
                        </div>
                        <div class="input-group">
                            <button type="submit" class="btn btn-primary">查 询</button>
                        </div>
                    </form>
                </div>
                <div class="ibox-content">
                    <div class="form-group clearfix col-sm-1">
                        <a href="{:url('add')}"><button class="btn btn-outline btn-primary" type="button">添加</button></a>
                    </div>
                    <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">

                        <thead>
                        <tr role="row">
                            <th>ID</th>
                            <th>姓名</th>
                            <th>电话</th>
                            <th>备注</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="list" id="vo"}
                            <tr  class="tr">
                                <td>{$vo.id}</td>
                                <td>{$vo.real_name}</td>
                                <td>{$vo.phone}</td>
                                <td>{$vo.beizu}</td>
                                <td>
                                    <a href="{:url('edit',['id'=>$vo.id])}"   class="label label-primary set">修改</a>
                                    <a href="javascript:;" onclick="del({$vo.id})"    class="btn btn-danger btn-xs">删除</a>
                                </td>
                            </tr>

                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="container-fluid text-center">
                    {$list->render()}
                </div>
            </div>
        </div>
    </div>
</div>

<script src="__STATIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/admin/js/plugins/layer/layer.min.js"></script>
<include file="public:footer"/>
</body>
<script type="text/javascript">
     function del(id) {
        layer.confirm('确定删除？', {
            btn: ['确定', '再想想...'] //按钮
        }, function (index) {
            layer.close(index);
            $.ajax({
                url: "{:url('del')}",
                type: 'post',
                data: { 'id': id},
                success: function (res) {
                    if (res.code = 1) {
                        layer.msg(res.msg, {icon: 1, time: 1000}, function () {
                            window.location.href = res.data;
                        })
                    } else {
                        layer.msg(res.msg, {icon: 2, time: 1000})
                    }
                },
                error: function (djson) {
                    layer.msg("网络错误请刷新", {time: 1500});
                }
            })
        }, function(index){
            layer.close(index);
            layer.closeAll();
        })
    }
</script>
</html>